package com.samphanie.auiu.app.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.samphanie.auiu.mbg.model.BaseEntity;
import lombok.*;
import lombok.experimental.SuperBuilder;
import org.springframework.security.core.GrantedAuthority;

import java.io.Serializable;
import java.util.Set;

/**
 * @author Dries
 * @email 1451691457@qq.com
 */
@Data
@With
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@TableName("sys_permissions")
@EqualsAndHashCode(callSuper = true)
public class Permissions extends BaseEntity implements GrantedAuthority, Serializable {
    private static final long serialVersionUID = -2344587170439189423L;

    @TableField(value = "permission_name")
    private String authority;

    private String displayName;

    @JsonIgnore
    @TableField(exist = false)
    private Set<Role> roles;
}
